﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using System.IO;

namespace OptiGear1
{
    public class WowClass
    {
        public string name;

        //armor
        public bool cloth = false;

        //weapons
        public bool oneHandedMaces = false;
        public bool daggers = false;
        public bool wands = false;
        public bool staves = false;
        public bool oneHandedSwords = false;

        public string Name
        {
            get { return name; }
        }

        public bool Cloth
        {
            get { return cloth; }
        }

        public bool OneHandedMaces
        {
            get { return oneHandedMaces; }
        }

        public bool Daggers
        {
            get { return daggers; }
        }

        public bool Wands
        {
            get { return wands; }
        }

        public bool Staves
        {
            get { return staves; }
        }

        public bool OneHandedSwords
        {
            get { return oneHandedSwords; }
        }

        public WowClass()
        {
        }

        public static List<WowClass> Deserialize(string fileName)
        {
            XmlSerializer mySerializer = new XmlSerializer(typeof(List<WowClass>));
            FileStream myFileStream = new FileStream(fileName, FileMode.Open);
            List<WowClass> classes = (List<WowClass>)mySerializer.Deserialize(myFileStream);
            myFileStream.Close();
            return classes;
        }        
    }    
}
